#include "ground.h"
#include "config.h"


ground::ground()
{
    Ground.load(GROUND_PATH);   //初始化加载地面对象
    groundpositionX=-31;         //设置初始坐标
    groundscrollspeed=SCENESCROLLSPEED;
}
//计算坐标
void ground::calculateposition(){
    groundpositionX-=groundscrollspeed;
}
grounds::grounds()
{
    for(int i=0;i<10;i++){
        Grounds[i].groundpositionX+=132*i;
    }
}
void grounds::Calculateposition(){
    for(int i=0;i<10;i++){
        Grounds[i].calculateposition();
        if(Grounds[i].groundpositionX<=-Grounds[i].Ground.width()){
            Grounds[i].groundpositionX+=132*9;
            distance+=5;
        }
    }
}
